﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Yun.Interface;
using Yun.Response;
using Yun.Util;

namespace Yun.Open.Request
{
    /// <summary>
    /// 更新外部方法
    /// yun.open.outermethod.update
    /// </summary>
    public class UpdateOutMethodRequest : ITopRequest<IntResultResponse>
    {
        public int Id { get; set; }

        /// <summary>
        /// 方法
        /// </summary>
        public string MethodName { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        public string Description { get; set; }


        /// <summary>
        /// URL
        /// </summary>
        public string Url { get; set; }


        public string GetApiName()
        {
            return "yun.open.outermethod.update";
        } 
        public IDictionary<string, string> GetParameters()
        {
            var parameters = new YunDictionary
            {
                {"id", Id },
                {"methodname", MethodName},
                {"description", Description},
                {"url", Url},
            };
            return parameters;
        }

        public void Validate()
        {
            RequestValidator.ValidateRequired("methodname", MethodName);           
            RequestValidator.ValidateRequired("url", Url);
        }


    }
}
